//package com.project.stream_consumer.demo6.controller;
//
//import com.project.stream_consumer.demo6.conf.MyInPut;
//import com.rabbitmq.client.Channel;
//import org.springframework.amqp.support.AmqpHeaders;
//import org.springframework.cloud.stream.annotation.EnableBinding;
//import org.springframework.cloud.stream.annotation.StreamListener;
//import org.springframework.messaging.Message;
//import org.springframework.messaging.handler.annotation.Header;
//import org.springframework.stereotype.Component;
//
//import java.io.IOException;
//
//@Component
//@EnableBinding(MyInPut.class) //引入上面新增的
//public class ConsunmerController {
//    @StreamListener(MyInPut.MYINPUT1) //指定监听类中的哪个通道
//    public void input1(Message<String> message,@Header(AmqpHeaders.CHANNEL) Channel channel,@Header(AmqpHeaders.DELIVERY_TAG) Long deliveryTag){
//        System.out.println("input1:"+message.getPayload());
//        try {
//            channel.basicAck(deliveryTag, false);
//        } catch (IOException e) {
//            e.printStackTrace();
//        }
//    }
//    @StreamListener(MyInPut.MYINPUT2)
//    public void input2(Message<String> message){
//        System.out.println("input2:"+message.getPayload());
//    }
//}